import com.gy.service.UserServiceGeneralImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Classname MyTest3
 * @Description TODO
 * @Date 2021/5/23 21:47
 * @Created by Administrator
 */
public class MyTest3 {
    public static void main(String[] args) {
        //获取ApplicationContext；拿到Spring的容器
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        //容器在手，天下我有，需要什么，就直接get什么！
        UserServiceGeneralImpl userServiceGeneral = (UserServiceGeneralImpl) context.getBean("userServiceGeneral");
        userServiceGeneral.getUser();
    }
}
